import { ProductData } from '@/data/common'
import Link from 'next/link'

export default function Page() {
  return (
    <div className="bg-white">
      <div className="mx-auto max-w-2xl px-4 py-16 sm:px-6 sm:py-24 lg:max-w-7xl lg:px-8">
        <h2 className="text-2xl font-bold tracking-tight text-gray-900">
          Customers also purchased
        </h2>

        <div className="mt-6 grid grid-cols-1 gap-x-6 gap-y-10 sm:grid-cols-2 lg:grid-cols-4 xl:gap-x-8">
          {ProductData.map((item, index) => {
            return (
              <div className="group relative" key={index}>
                <img
                  src={item.img}
                  alt="Front of men&#039;s Basic Tee in black."
                  className="aspect-square w-full rounded-md bg-gray-200 object-cover group-hover:opacity-75 lg:aspect-auto lg:h-80"
                />
                <div className="mt-4 flex justify-between">
                  <div>
                    <h3 className="text-sm text-gray-700">
                      <Link href={`/product/${item.id}`}>
                        <span aria-hidden="true" className="absolute inset-0"></span>
                        Basic Tee
                      </Link>
                    </h3>
                    <p className="mt-1 text-sm text-gray-500">{item.title}</p>
                  </div>
                  <p className="text-sm font-medium text-gray-900">$35</p>
                </div>
              </div>
            )
          })}
        </div>
      </div>
    </div>
  )
}
